package cn.edu.sdjzu.xg23.kcsj01_backend.entity.authority;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Permission {
    private Long id;
    private String description; //权限描述
    private String no; //权限标识符
    private String permissionCode; //权限码
    private Collection<Role> roles; //权限对应的角色
    private Long parentId; // 新增：明确父节点ID
    private List<Permission> children = new ArrayList<>(); // 新增：子节点列表

    public Permission(Long permissionId) {
        this.id = permissionId;
    }
}
